function ajax() {
    return new Promise((resolve,reject)=>{
        setTimeout(()=>{
            resolve('Hello Jest');
        },Math.random()*100|0);
    });
}


test('then',()=>{
    return ajax().then(data=>{
        expect(data).toBe('Hello Jest');
    });
});